package org.linkerproject.html;

public class HtmlPage {

	public HtmlPage(String title) {
		this.title = title;
	}

	public String output() {
		StringBuffer html = new StringBuffer("");
		html.append("<html>");
		html.append("<head>");
		html.append("<title>" + title + "</title>");
		html.append(headContainer.output());
		html.append("</head>");
		html.append("<body>");
		html.append(bodyContainer.output());
		html.append("</body>");
		html.append("</html>");

		return html.toString();
	}

	public void addBodyContent(HtmlElement link) {
		bodyContainer.addElement(link);
	}

	private String title;

	private HtmlContainer headContainer = new HtmlContainer();
	private HtmlContainer bodyContainer = new HtmlContainer();

}
